#include <soar.h>

#include <openssl/opensslv.h>

int main()
{
    pthread_attr_t thrd_attr;
    size_t stack_size;

#if defined(__linux__)
    printf("Linux\n");
#endif
#if defined(__FreeBSD__)
    printf("FreeBSD\n");
#endif
#if defined(__APPLE__)
    printf("Apple\n");
#endif
#if defined(__Solaris__)
    printf("Solaris\n");
#endif
    printf("\n");

    printf("bits: %d\n", __WORDSIZE);

#if BYTE_ORDER == LITTLE_ENDIAN
    printf("Little Endian\n");
#else
    printf("Big Endian\n");
#endif
    printf("\n");

#if (OPENSSL_VERSION_NUMBER >> 12) == 0x00906L
    printf("openssl 0.9.6\n");
#elif (OPENSSL_VERSION_NUMBER >> 12) == 0x00907L
    printf("openssl 0.9.7\n");
#elif (OPENSSL_VERSION_NUMBER >> 12) == 0x00908L
    printf("openssl 0.9.8\n");
#elif (OPENSSL_VERSION_NUMBER >> 12) > 0x00908L
    printf("openssl > 0.9.8\n");
#endif
    printf("\n");

    pthread_attr_init(&thrd_attr);
    pthread_attr_getstacksize(&thrd_attr, &stack_size);
    printf("thrd: stacksize = %d\n", (int)stack_size);
    if(pthread_attr_setstacksize(&thrd_attr, KB(64)))
    {
        printf("pthread_attr_setstacksize fail\n");
        return(-1);
    }
    pthread_attr_getstacksize(&thrd_attr, &stack_size);
    printf("thrd: reset stacksize -> %d\n", (int)stack_size);
    printf("\n");

    //printf("file_offset_bits: %d\n", _FILE_OFFSET_BITS);

    printf("pid_t: %ld\n", sizeof(pid_t));

    return(0);
}
